#include "MsgRecv.h"
#include "Server.h"

void MsgRecv::Work()
{
	while(m_working)
	{
        Networking::SockMsg msg;
        if(!m_sock || !m_sock->IsOpen())
        {
            OUT_STRING("MsgRecv Thread has an invalid socket!!");
            return;
        }

        if(m_sock->Receive(&msg))
            AddGm(msg);
	}
}
void MsgRecv::SetSocket( Networking::Socket* sock)
{
	m_sock = sock;
}